/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package megachess.svn;

/**
 *
 * @author johannes
 */
public class Square {
    
    private int col,row;

    public int getCol() {
        return col;
    }

    public int getRow() {
        return row;
    }
    
    public Square(String currentSquare){
        
        char[] csquare = currentSquare.toCharArray();
        
        if(csquare[0]=='a')
            col=1;
        else if(csquare[0]=='b')
            col=2;
        else if(csquare[0]=='c')
            col=3;
        else if(csquare[0]=='d')
            col=4;
        else if(csquare[0]=='e')
            col=5;
        
       
        row=(csquare[1] - '0');
  }
    
    public String getSquareString()
    {
        char column =' ' ;
        
         if(col==1)
            column='a';
         else if (col==2)
             column='b';
        else if (col==3)
             column='c';
        else if (col==4)
             column='d';
        else if (col==5)
             column='e';
         
         Integer j = new Integer(row);
         
         
         String output= column + j.toString();
         
         
        return output; 
    
    }//end method
    
    public Square(int col, int row){
        
        this.col = col;
        this.row = row;
        
        
    }
    
}
